!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[StateBox]",["react","reactDOM"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[StateBox]"]=t(require("react"),require("react-dom")):e["rb_wixui.thunderbolt[StateBox]"]=t(e.React,e.ReactDOM)}("undefined"!=typeof self?self:this,(function(e,t){return function(){var n={5329:function(t){"use strict";t.exports=e},95561:function(e){"use strict";e.exports=t},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;tt().createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t().createElement("circle",{cx:"12",cy:"12",r:"11.5",fill:"white",stroke:"black"}),t().createElement("path",{d:"M9.11923 17.4383L9.11916 17.4383C8.85811 17.6003 8.5 17.4181 8.5 17.0757V6.92427C8.5 6.58188 8.85811 6.39972 9.11916 6.56171L9.1192 6.56173L17.3014 11.6379L17.3018 11.6382C17.5657 11.8015 17.5666 12.1984 17.3013 12.3631L9.11923 17.4383Z",stroke:"black"})),c=()=>t().createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t().createElement("circle",{cx:"12",cy:"12",r:"11.5",fill:"white",stroke:"black"}),t().createElement("rect",{x:"9",y:"7",width:"1",height:"10",rx:"0.5",fill:"black"}),t().createElement("rect",{x:"14",y:"7",width:"1",height:"10",rx:"0.5",fill:"black"}));var u="W2bcb7";const d=()=>{};var p=n=>{let{testId:r,className:o,state:s,pauseAriaLabel:i,resumeAriaLabel:p,ariaControls:f,onPause:h=d,onResume:v=d,buttonRef:m}=n;const x="paused"===s,E=(0,e.useMemo)((()=>x?v:h),[x,v,h]);return t().createElement("button",{"data-testid":r,ref:m,className:a(u,o),type:"button","aria-label":x?p:i,"aria-pressed":"playing"===s,"aria-controls":f,onClick:E},x?t().createElement(l,null):t().createElement(c,null))};const f="wixui-",h=(e,...t)=>{const n=[];return e&&n.push(`${f}${e}`),t.forEach((e=>{e&&(n.push(`${f}${e}`),n.push(e))})),n.join(" ")};const v=()=>"function"==typeof window.IntersectionObserver;const m={left:"onSwipeLeft",right:"onSwipeRight",up:"onSwipeUp",down:"onSwipeDown"},x=e=>{if(e.touches&&e.touches.length){const t=e.touches[0];return{x:t.pageX,y:t.pageY}}},E={touched:!0,moved:!1,deltaCoords:{x:0,y:0}},g=(e,t,n)=>()=>{let r;const o=e=>{r={...E,numOfTouches:e.touches.length,startCoords:x(e),startTime:Date.now(),evObj:{...e}}},s=e=>{if(!r)return;const t=x(e);if(t){r.startCoords||(r.startCoords=t);const e=r.startCoords.x-t.x,n=r.startCoords.y-t.y;r.moved=!0,r.deltaCoords={x:e,y:n}}},i=()=>{if(r)if(r.endTime=Date.now(),"onTap"===e&&(e=>e.touched&&!e.moved&&1===e.numOfTouches)(r))t(r.evObj);else if((e=>e.moved&&1===e.numOfTouches&&e.endTime-e.startTime<500&&(Math.abs(e.deltaCoords.x)>100||Math.abs(e.deltaCoords.y)>60))(r)){const n=((e,t)=>{let n;return n=Math.abs(e)>Math.abs(t)?e>0?"left":"right":t>0?"up":"down",n})(r.deltaCoords.x,r.deltaCoords.y);e===m[n]&&t(r.evObj)}};return n&&n.current&&(n.current.addEventListener("touchstart",o,{passive:!0}),n.current.addEventListener("touchmove",s,{passive:!0}),n.current.addEventListener("touchend",i,{passive:!0})),()=>{n&&n.current&&(n.current.removeEventListener("touchstart",o),n.current.removeEventListener("touchmove",s),n.current.removeEventListener("touchend",i))}},b=(t,n,r)=>e.useEffect(g(t,n,r),[t,r,n]),y="Slideshow",C="Next",S="Previous",w="Slides",k="slidesWrapper",N="nextButton",O="prevButton",P="shadowLayer",L="pauseResumeButton",A="NoTransition";var R={root:"slideshow"};var T,M={root:"multi-state-box"},B={thinArrowsSkin:"JMUd8Z","slide-show-container":"mDzRgi",slideShowContainer:"mDzRgi",thinArrowsLargeSelectedCircleSkin:"QodGTM","nav-btn":"XvQ3FE",navBtn:"XvQ3FE","prev-btn":"CdshHv",prevBtn:"CdshHv","next-btn":"Qinjwp",nextBtn:"Qinjwp",slides:"hDJzl4","in-transition":"tAoGqR",inTransition:"tAoGqR","slides-dynamic-height":"T23gn7",slidesDynamicHeight:"T23gn7",shadowLayer:"N2NGoO","dots-nav-section":"lZ5yqT",dotsNavSection:"lZ5yqT","dots-nav-list":"dZxZOk",dotsNavList:"dZxZOk","nav-dot":"ZVUGJp",navDot:"ZVUGJp",selected:"Ale4Rm",playbackControl:"W44q6c",longArrowsLargeSelectedCircleSkin:"ENJ6Ca",squareButtonsSkin:"ghJlnq",StateBoxSkin:"XVHXq_",stateBoxSkin:"XVHXq_"};function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;tnull};var Z=t=>{let{skin:n,direction:r,moveToNextSlide:o,moveToPrevSlide:s,translations:i}=t;const l=q[n],c=e.createElement("button",{"data-testid":O,"aria-label":i.prevButtonAriaLabel||S,onClick:s,className:a(B.navBtn,B.prevBtn)},e.createElement(l,null)),u=e.createElement("button",{"data-testid":N,"aria-label":i.nextButtonAriaLabel||C,onClick:o,className:a(B.navBtn,B.nextBtn)},e.createElement(l,null)),d="rtl"===r;return e.createElement(e.Fragment,null,d?[u,c]:[c,u])};var z=t=>{let{translations:n,currentSlideIndex:r,slidesProps:o,isPlaying:s,focusSlideShow:i,changeSlide:l}=t;return e.createElement("nav",{"aria-label":n.navDotsAriaLabel||w,className:B.dotsNavSection},e.createElement("ol",{className:B.dotsNavList},o.map(((t,n)=>((t,n)=>e.createElement("li",{key:t.id,"aria-current":n===r?"true":void 0},e.createElement("a",{href:"./#"+t.id,"aria-label":t.title,onClick:e=>{e.preventDefault(),e.stopPropagation(),n!==r&&l(n),s||i()},className:a(B.navDot,{[B.selected]:n===r})})))(t,n)))))};function U(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{reverse:n,...o}=t;return e.createElement(xe,r()({},o,{classNames:{enter:Ee,enterActive:ge,exit:be,exitActive:ye}}),t.children)},OutIn:t=>{const{reverse:n,...o}=t;return e.createElement(xe,r()({},o,{classNames:{enter:Ce,enterActive:Se,exit:we,exitActive:ke}}),t.children)},SlideHorizontal:t=>{const{reverse:n,...o}=t;return e.createElement(xe,r()({},o,{classNames:n?{enter:Ae,enterActive:Re,exit:Te,exitActive:Me}:{enter:Ne,enterActive:Oe,exit:Pe,exitActive:Le}}),t.children)},SlideVertical:t=>{const{reverse:n,...o}=t;return e.createElement(xe,r()({},o,{classNames:n?{enter:Ve,enterActive:He,exit:Fe,exitActive:_e}:{enter:Be,enterActive:je,exit:De,exitActive:Ie}}),t.children)}};var Ze=t=>{const n=qe[t.type],{type:r,...o}=t;return e.createElement(n,o)};const ze=(t,n)=>{let{isPlaying:r,isSlideShowInViewport:o,reverse:s,transition:i,transitionDuration:l,currentSlideIndex:c,onSlideEntered:u,onSlideExited:d,children:p,dynamicHeight:f,inTransition:h}=t;const v=!o||r&&o?"off":"polite",m="SlideVertical"===i||"SlideHorizontal"===i;return"NoTransition"===i?e.createElement("div",{ref:n,"data-testid":k,className:a(B.slides,f?B.slidesDynamicHeight:void 0),"aria-live":v},p):e.createElement("div",{ref:n,"data-testid":k,"aria-live":v,className:a(B.slides,f?B.slidesDynamicHeight:void 0,h&&m?B.inTransition:void 0)},e.createElement(te,{component:null,childFactory:t=>e.cloneElement(t,{reverse:s})},e.createElement(Ze,{type:i,key:c,timeout:l,onEntered:u,onExited:d,unmountOnExit:!0},p)))};var Ue=e.forwardRef(ze);const Xe=(n,o)=>{const{id:s,className:i,customClassNames:l=[],skin:c,hasShadowLayer:u,translations:d,currentSlideIndex:f,slidesProps:m,showNavigationDots:x,showNavigationButton:E,autoPlay:g,initialAutoPlay:C,showPlaybackControl:S,shouldChangeSlidesOnSwipe:w=!0,autoPlayInterval:k,pauseAutoPlayOnMouseOver:N,transition:O,transitionDuration:T,transitionReverse:j,direction:D,changeSlide:I,reducedMotion:V,children:H,onCurrentSlideChanged:F,onChange:_,onMouseEnter:q,onMouseLeave:U,onClick:X,onDblClick:G,play:J,onPlay:W,pause:$,onPause:Q,isPlaying:Y=g&&e.Children.toArray(H()).length>1&&!V,dynamicSlidesHeight:K=!1,observeChildListChange:ee}=n,{isPaused:te,isHovered:ne,setIsHovered:re,isFocused:oe,setIsPaused:se,setIsFocused:ie,onFocus:ae,playbackControlButtonRef:le}=function(n){let{autoplay:r}=n;const[o,s]=(0,e.useState)(!1),[i,a]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!r),u=t().useRef(null);return{isHovered:o,setIsHovered:s,isFocused:i,onFocus:(0,e.useCallback)((e=>{e.nativeEvent.target!==u.current&&a(!0)}),[a,u]),setIsFocused:a,isPaused:l,setIsPaused:c,playbackControlButtonRef:u}}({autoplay:Y});(0,e.useEffect)((()=>{se(!Y)}),[Y,se]);const[ce,ue]=e.useState(!1),[de,pe]=e.useState(!1),fe=e.useRef(null),he=!V&&O!==A,ve=e.useMemo((()=>j?!ce:ce),[ce,j]),me=e.Children.toArray(H()),xe=g&&me.length>1&&!V,Ee=e.useRef(null),ge=!te&&!(ne&&xe&&N)&&!(oe&&xe),be=e.useCallback((e=>{let{slideIndex:t,isBackward:n,callback:r}=e;if(de||t===f)"function"==typeof r&&r();else{if(he&&"function"==typeof r&&(Ee.current=r),he){pe(!0);ue(!!(void 0===n?t{re(!0),null==q||q(e)}:q,we=xe&&N?e=>{re(!1),null==U||U(e)}:U,ke=xe?{onFocus:ae,onBlur:()=>{ie(!1)}}:{},Ne=e.useRef(null),Oe=function(t,n){void 0===n&&(n=!1);const[r,o]=(0,e.useState)(!1);return(0,e.useEffect)((()=>{if(!v())return o(n),()=>{};const e=t.current;if(e&&v()){const t=new window.IntersectionObserver((e=>{const t=e[e.length-1];o(t.isIntersecting)}));return t.observe(e),()=>{t.disconnect()}}return()=>{}}),[t,n]),r}(Ne);b("onSwipeLeft",(()=>w&&ye()),Ne),b("onSwipeRight",(()=>w&&Ce()),Ne),function(t,n){const r=(0,e.useRef)((()=>{}));(0,e.useEffect)((()=>{r.current=t}),[t]),(0,e.useEffect)((()=>{if(null!==n){const e=setInterval((function(){r.current()}),n);return()=>clearInterval(e)}return()=>{}}),[n])}(ye,ge&&Oe?k:null);const Pe=e.useCallback((()=>({height:{[s]:()=>{const e=document.getElementById(s);return e?e.clientHeight:0}}})),[s]);e.useImperativeHandle(o,(()=>({play:()=>{J(),null==W||W({type:"autoplayOn"})},pause:()=>{$(),null==Q||Q({type:"autoplayOff"})},moveToSlide:be,next:ye,previous:Ce,getCustomMeasures:Pe})),[ye,Ce,be,Pe,Q,W,$,J]);const Le="StateBoxSkin"===c?M.root:R.root;return e.useEffect((()=>{ee&&null!=fe&&fe.current&&ee(s,fe.current)}),[]),e.createElement("div",r()({id:s},(e=>Object.entries(e).reduce(((e,[t,n])=>(t.includes("data-")&&(e[t]=n),e)),{}))(n),{ref:Ne,className:a(i,B.slideShowContainer,B[c],"ignore-focus",h(Le,...l)),role:"region",tabIndex:-1,"aria-label":d.slideShowAriaLabel||y,onClick:X,onDoubleClick:G,onMouseEnter:Se,onMouseLeave:we},ke),E&&e.createElement(Z,{direction:D,skin:c,translations:d,moveToNextSlide:ye,moveToPrevSlide:Ce}),u&&e.createElement("div",{"data-testid":P,className:B.shadowLayer}),e.createElement(Ue,{ref:fe,isPlaying:ge,isSlideShowInViewport:Oe,reverse:ve,transition:V?A:O,transitionDuration:T,currentSlideIndex:f,inTransition:de,onSlideEntered:()=>{he&&pe(!1)},onSlideExited:()=>{null==F||F(f),Ee.current&&(Ee.current(),Ee.current=null)},dynamicHeight:K},me[f]),x&&e.createElement(z,{focusSlideShow:()=>{var e;return null==(e=Ne.current)?void 0:e.focus()},translations:d,slidesProps:m,currentSlideIndex:f,changeSlide:e=>{be({slideIndex:e})}}),S&&C&&e.createElement(p,{buttonRef:le,testId:L,state:te?"paused":"playing",className:B.playbackControl,pauseAriaLabel:d.pauseControlAriaLabel,resumeAriaLabel:d.playControlAriaLabel,onPause:()=>se(!0),onResume:()=>se(!1)}))};var Ge=e.forwardRef(Xe);const Je=(t,n)=>{const r={dynamicSlidesHeight:!0,shouldChangeSlidesOnSwipe:!1,autoPlayInterval:1e3,pauseAutoPlayOnMouseOver:!1,transitionReverse:!1,showNavigationDots:!1,showNavigationButton:!1,slidesProps:[],autoPlay:!1,initialAutoPlay:!1,showPlaybackControl:!1,...t,ref:n};return e.createElement(Ge,r)};const We=e=>e.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`));var $e;const Qe={StateBox:{component:e.forwardRef(Je),controller:($e=e=>{let{mapperProps:t,controllerUtils:n,stateValues:r}=e;return{...t,changeSlide:e=>{n.updateProps({currentSlideIndex:e})},observeChildListChange:t.isMasterPage?r.observeChildListChangeMaster:r.observeChildListChange}},{useComponentProps:(e,t,n)=>{const r=(e=>({...e,updateStyles:t=>{const n=Object.entries(t).reduce(((e,[t,n])=>{return{...e,[(r=t,r.startsWith("--")?t:We(t))]:void 0===n?null:n};var r}),{});e.updateStyles(n)}}))(n);return $e({mapperProps:e,stateValues:t,controllerUtils:r})}})}}}(),s}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[StateBox].58370d65.bundle.min.js.map